# -*- coding: utf-8 -*-
class SysMsg < ActiveRecord::Base
  belongs_to :editor, :class_name => 'Employee', :foreign_key => 'employee_id'
  scope :employee_like, ->(companyId,employeeId) { where('company_id = ? AND employee_id = ?', companyId,employeeId)}

  scope :unread, -> {where(:is_new => '未读')}

  scope :paginate, ->(start,limit) { offset(start.to_i).limit(limit.to_i).order("id DESC")}
end
